package com.supply.dl.widget.adapter;

import android.support.annotation.Nullable;
import com.chad.library.adapter.base.BaseViewHolder;
import com.supply.dl.R;
import com.supply.dl.bean.BaseItemBean;
import com.supply.dl.bean.WorkFunctionBean;

import java.util.List;

/**
 * Created by ${qianzhihe} on 2018/4/23.
 * 工作主界面列表
 */

public class WorkFragmentAdapter extends BaseAdapter{

    public WorkFragmentAdapter(int layoutResId, @Nullable List<BaseItemBean> data) {
        super(layoutResId, data);
    }

    public WorkFragmentAdapter(@Nullable List<BaseItemBean> data) {
        super(data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BaseItemBean item) {
        super.convert(helper, item);
        WorkFunctionBean workFunctionBean = (WorkFunctionBean) item.object;
        helper.setText(R.id.fragment_work_main_item_functionName, workFunctionBean.functionName);
        helper.setImageResource(R.id.fragment_work_main_item_functionImage, workFunctionBean.resId);
        helper.addOnClickListener(R.id.fragment_work_main_item_functionLayout);
    }
}
